#-*- coding: utf-8 -*-
'''
Created on 2016年9月29日

@author: hp
'''
from com.unitoll.test.data.excel_reader import ExcelReader

class ExcelStruct(object):
    
    def __init__(self, excel_file, sheet_name):
        self.excel_reader = ExcelReader(excel_file)
        self.sheet_name = sheet_name
        self.row_num = self.excel_reader.get_row_num_by_name(sheet_name)
        self.col_num = self.excel_reader.get_col_num_by_name(sheet_name)
        self.cells = []
        for i in range(self.row_num):
            row_cell = []
            for j in range(self.col_num):
                row_cell.append(self.excel_reader.get_cell_value_by_name(sheet_name, i, j))
            self.cells.append(row_cell)
    
    def get_cell_value(self, row_index, col_index):
        return self.cells[row_index][col_index]
        